00001 <?php  
00013  $root_path = "../../";
00014  
00015  ##########################################################################
00016  #Incluimos el archivo que verifica si se ha iniciado una sesion
00017  include_once('valida_session.php');
00018  ########################################################################
00019  #Variables
00020 
00023  $fecha;
00027  $LD_var;
00028         
00032  $hora;
00036  $motivo;                
00040  $examen_f;
00044  $enfermedad_actual;     
00045   
00046 
00047 ?>
00048 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
00049 <html>
00050 <head>
00051 <title>Ingreso Consulta</title>
00052 <script language="JavaScript" type="text/javascript">
00053 <!--
00054  function confirmar()
00055  {
00056   if(confirm('Esta seguro de querer eliminar el registro?'))
00057    return true;
00058         else
00059          return false; 
00060  }
00061  function eliminar(variables)
00062  {                                      
00063         comfirmar = confirmar()
00064         if(comfirmar == true)
00065         {
00066           window.open('eliminar_admision.php'+variables, '', 'toolbar=no,scrollbars=1,location=0,statusbar=1,status=1,menubar=0,resizable=0,width=1,height=1,left = 220,top = 100'); 
00067     setTimeout ('history.back(1)', 3000); 
00068   }
00069  }
00070  function eliminar1(variables,var_history)
00071  {                                      
00072         comfirmar = confirmar()
00073         if(comfirmar == true)
00074         {
00075           window.open('eliminar_admision.php'+variables, '', 'toolbar=no,scrollbars=1,location=0,statusbar=1,status=1,menubar=0,resizable=0,width=1,height=1,left = 220,top = 100'); 
00076     setTimeout ('history.back(1)', 5000);  
00077           location.replace(var_history)
00078   }
00079  } 
00080 //-->
00081 </script>
00082 </head>
00083 <body>
00084 <?php   
00085  ###################################################################
00086  #Realizamos la conexion
00087  include_once("conexion.php");
00088    
00089  #Este formulario aveces es llamado por otro que le envia la variable
00090  #$last_id, cuando se la envia entonces se le debe asiganar esa variable
00091  #a $id_evolucion
00092 
00096  $last_id = $last_id;
00097  if($last_id)
00098   $id_evolucion = $last_id;
00099  else
00100   $id_evolucion = $HTTP_GET_VARS['id_evolucion']; 
00101   
00102  ########################################################################
00103 
00106  $sql = "select ic.pid_persona,ic.nr_especialidad,cd.LD_var, e.fecha, e.hora, e.motivo,e.examen_fisico,e.enfermedad_actual from evolucion e,ingreso_consulta ic, care_department cd where id_evolucion = '$id_evolucion' and e.id_consulta = ic.id_consulta and ic.nr_especialidad = cd.nr";   
00107  ########################################################################
00108  #Sacamos los datos de la evolucion
00109  $cursor = $db->Execute($sql);
00110          
00111  if($vector_data=$cursor->FetchRow())
00112  {   
00113          $LD_var = $vector_data['LD_var'];         
00114          $fecha = $vector_data['fecha'];         
00115          $motivo = $vector_data['motivo'];       
00116          $hora = $vector_data['hora'];   
00117          $examen_f = $vector_data['examen_fisico'];
00118          $enfermedad_actual = $vector_data['enfermedad_actual'];   
00119    $pid = $vector_data['pid_persona'];
00120    $departamento = $vector_data['nr_especialidad'];
00121  } 
00122 ?>
00123 <div align="center">
00124  <FONT  COLOR="#330066"  SIZE=+2  FACE="Arial">
00125    <strong>
00126            Historia Cl&iacute;nica
00127    </strong>
00128  </font>         
00129 </div>
00130 <p></p>
00131 <table width="90%" align="left" height="317">
00132     <tr> 
00133       <td width="35%" height="30" bgColor="#eeeeee">
00134                          <font size=-1 face="Arial">
00135                           Fecha:
00136                          </font>
00137                         </td>
00138       <td bgcolor="#ffffee">
00139        <font size=-1 face="Arial" color="#990000">
00140                           <strong>
00141                          <?php                                            
00142                                  echo $fecha 
00143                          ?>       
00144                           </strong>  
00145                          </font>
00146                         </td>
00147     </tr>
00148                 <tr>
00149                  <td bgColor="#eeeeee">
00150                    <font size=-1 face="Arial">Hora:</font> 
00151                  </td>
00152                  <td bgcolor="#ffffee">
00153                   <font size=-1 face="Arial">
00154                          <font size=-1 face="Arial" color="#990000">
00155                           <strong> 
00156                          <?php
00160                                 echo $hora; 
00161                          ?>
00162                           </strong>
00163                          </font>        
00164                         </font> 
00165                  </td>
00166                 </tr>
00167                 <tr>
00168                  <td bgcolor="#eeeeee">
00169                   <font size=-1 face="Arial">
00170                     Especialidad
00171                   </font>
00172                  </td>
00173                  <td bgcolor="#ffffee">                  
00174       <font size=-1 face="Arial" color="#990000">
00175                          <strong>
00176                         <?php
00177                         #Aqui incluimos el archivo que tiene el nombre de las variables
00178       #de los departamentos
00179       if(file_exists("../../language/es/lang_es_departments.php"))
00180       {
00181        include("../../language/es/lang_es_departments.php");     
00182       }
00183       else
00184        echo "No existe el archivo de departamentos";
00185                         
00186                         #Aqui escribimo el nombre de la especialidad
00187                         echo "&nbsp; ".$$LD_var;
00188                         ?>              
00189                    </strong>
00190                         </font>
00191                  </td>
00192     </tr>                                   
00193                 <tr> 
00194       <td width="35%" height="86" bgcolor="#eeeeee">
00195                          <font size=-1 face="Arial">Motivo</font></td>
00196       <td width="42%" height="86" bgcolor="#ffffee"><font size=-1 face="Arial" color="#990000">                    
00197         <textarea name="motivo" cols="50" rows="4" readonly><?php echo $motivo; ?></textarea>
00198         </font></td>
00199     </tr>
00200                 <tr> 
00201       <td width="35%" height="86" bgcolor="#eeeeee"><font size=-1 face="Arial">Examen Fisico</font></td>
00202       <td width="42%" height="86" bgcolor="#ffffee"><font size=-1 face="Arial"> 
00203         <textarea name="examen_f" cols="50" rows="4" readonly><?php echo $examen_f; ?></textarea>
00204         </font></td>
00205     </tr>
00206     <tr> 
00207       <td width="35%" height="78" bgcolor="#eeeeee"><font size=-1 face="Arial">Enfermedad Actual</font></td>
00208       <td width="42%" height="78" bgcolor="#ffffee"><font size="2"> 
00209         <textarea name="enfermedad_actual" cols="50" rows = "4" readonly><?php echo $enfermedad_actual;?></textarea>
00210         </font></td>
00211     </tr>
00212     <tr> 
00213       <td width="35%" height="63" bgcolor="#eeeeee"><font size=-1 face="Arial">Diagn&oacute;stico de Ingreso</font></td>
00214       <td width="42%" height="63" bgcolor="#ffffee">                     
00215                           <font size=-1 face="Arial" color="#990000">
00216                           <strong>
00217                                 <?php
00218                                  ###############################################################
00219                                  #Sacamos los diagnosticos asociados                             
00220 
00223                                  $id_evolucion = $id_evolucion;
00224                                  $sql = "select diagnostico from evolucion_diagnostico ed, diagnostico d where ed.id_evolucion = '$id_evolucion' and ed.id_diagnostico = d.id_diagnostico";            
00225                                  $cursor = $db->Execute($sql);
00226          while($vector_data=$cursor->FetchRow())
00227          {
00228                                    if(!$cont)
00229                                          {
00230                                           echo $vector_data['diagnostico'];
00231                                     $cont = 1;
00232                                          }
00233                                         else
00234                                          echo ", ".$vector_data['diagnostico']; 
00235                                  }
00236                          
00237                                 ?>
00238                                 </strong>          
00239        </font>
00240                         </td>
00241     </tr>
00242                 <tr>
00243                  <td align="center" colspan="2">
00244                    <?php
00245         #######################################################################
00246         #Le asignamos la ruta a la imagen
00247 
00250                                 $root_imagen = "../../gui/img/control/default/es/";
00251        
00252                          #######################################################################                         
00253 
00256                          $variables = "?pid=$pid&departamento=$departamento&id_evolucion=$id_evolucion";                         
00260                          $archivo;
00261                          if($archivo == "ingreso_datos_admision.php")
00262                          {                                               
00267                                  $vars.= "&archivo=".$archivo;    
00268                          ?>
00269                           <br>
00270                          <img src="<?php echo $root_imagen; ?>es_back2.gif" alt="Boton Atras" onclick="javascript:location.replace('listar_consultas.php<?php echo $vars; ?>')">                                                  
00271                          <img src="<?php echo $root_imagen; ?>es_reset.gif" alt="Eliminar" onclick="javascript:eliminar1('<?php echo $variables ?>','listar_consultas.php<?php echo $vars; ?>')" />
00272                          <?php
00273                          }
00274                          else
00275                          {                        
00276                          ?>
00277                           <br>
00278                          <img src="<?php echo $root_imagen; ?>es_back2.gif" alt="Boton Atras" onclick="javascript:history.go(-1)">                       
00279                          <img src="<?php echo $root_imagen; ?>es_reset.gif" alt="Eliminar" onclick="javascript:eliminar('<?php echo $variables ?>')" />
00280                          <?php 
00281                          }                       
00282                          ?>                      
00283                          <a href="reportes_pdf/rep_ing_paciente.php?id_evolucion=<?php echo $id_evolucion ?>" target=_blank><img src="<?php echo $root_imagen; ?>es_printout.jpg" alt="Imprimir" width="85"  ></a>
00284                  </td>
00285                 </tr>
00286 </table>
00287 <center>         
00288 </center>
00289 </form>
00290 </body>
00291 </html>
